/****************************************************
          File Name:9-3.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sun 21 Dec 2014 03:06:24 PM CST
*****************************************************/

#include<iostream>
using namespace std;

struct chaff
{
    char dross[20];
    int slag;
};

int main()
{
    char *store = new char[10*sizeof(chaff)];
    chaff *test = new(store) chaff;             // place test into store

    char *dross;
    cout << "Enter dross: ";
    cin.getline(test->dross, 20);
    cout << "Enter slag: ";
    cin >> test->slag;

    cout << "------ show input -------\n";
    cout << test->dross << endl;
    cout << test->slag << endl;

    delete [] store;
    //delete [] test; // don't need

    return 0;

}
